﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
using WinnerCMS.Common;
using WinnerCMS.BLL;
using WinnerCMS.PlugIn.Scheduler;
namespace WinnerCMS.PlugIn.Task
{
    /// <summary>
    /// 无人值守
    /// </summary>
    public class UnattendedOperation : IScheduler
    {

        #region 取得网页源代码
        /// <summary>
        /// 取得网页源代码
        /// </summary>
        /// <param name="strUrl">要取的URL</param>
        /// <returns>网页源代码</returns>
        public void Execute(object parameterized)
        {
            string strUrl = WebConfig.DomainName + "/" + WebConfig.VirtualPath + "/Error.aspx";
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strUrl);
            request.ProtocolVersion = HttpVersion.Version11;
            request.Credentials = CredentialCache.DefaultCredentials;
            request.Timeout = 30 * 1000;//60秒钟
            request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";

            request.GetResponse(); 
        }
        #endregion
    }
}